import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class GeneratePassword {
  static Widget generatePasswordWidget(String pwd, bool showPassword) {
    if (showPassword) {
      return Text(
        pwd,
        style: TextStyle(
          fontSize: 14.sp,
          color: Color.fromRGBO(51, 51, 51, 1),
          height: 20.w / 14.w,
          fontWeight: FontWeight.w400,
        ),
      );
    } else {
      List<Widget> widgets = [];
      for (var i = 0; i < pwd.length; i++) {
        widgets.add(Padding(
          padding: EdgeInsets.only(right: 4.w),
          child: DecoratedBox(
            decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.black),
            child: SizedBox(
              width: 8.w,
              height: 8.w,
            ),
          ),
        ));
      }
      return Row(
        children: widgets,
      );
    }
  }
}
